package part1;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Main2Read
 *  - Read from a text file
 * @author tony
 *
 */

public class Main2Read {
	public static void main(String[] args) {
		final String INPUTFILENAME = "output.txt";

		System.out.println("In this program we will read data from the file "
				+ INPUTFILENAME);

		Scanner read;
		try {
			read = new Scanner(new File( INPUTFILENAME ));
			int x = read.nextInt();
			String y = read.next();
			read.close();

			System.out.println("OK, done. The file had: x = " + x
					+ ", and y = " + y);

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

}
